package com.hmy.equipment.rabbitMq;


import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Component;

@Component
public class MessageListener {


    @Autowired
    WebSocket webSocket;
    @RabbitListener(queues = "device")
    public void handleMessage(Message message ) {


        System.out.println("1kk" + message);
        webSocket.sendAllMessage(message.toString());
        System.out.println("2kk" + message);
    }
}
